package app;
import java.util.Scanner;
/*
 * 面试题英华学校
 */
public class Main {
    public static void main(String[] args) {
        myibsn();
    }

    public static void myibsn() {
        // 初始化接收类
        Scanner scanner = new Scanner(System.in);
        // 接收输入的数据
        String str_ibsn = scanner.next();
        scanner.close();
        int[] int_ibsn = new int[10];
        // 接收到的是字符串把他转为字符数组
        char[] char_ibsn = str_ibsn.toCharArray();
        // for循环访问把字符数组去掉“-”放入到int类型的数组中
        for (int i = 0, j = 0; i < char_ibsn.length; i++) {
            if (char_ibsn[i] == 'X') {
                int_ibsn[j++] = 10;
            } else if (char_ibsn[i] != '-') {
                int_ibsn[j++] = Integer.parseInt(char_ibsn[i] + "");
            }
        }
        // 定义识别码，code为自己计算的识别码
        int sum = 0, code;
        for (int j = 0; j < 9; j++) {
            sum += ((j + 1) * int_ibsn[j]);
        }
        code = sum % 11;
        // 定义暂存变量，暂存接收到的字符串最后一位识别码
        // 把字符型的识别码转为int类型
        if (code == int_ibsn[9]) {
            System.out.println("Right");
        } else if (code == 10)  System.out.println(str_ibsn.substring(0, 11) + "-" + 'X');
             else  System.out.println(str_ibsn.substring(0, 11) + "-" + code);
    }
}